#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "Action.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class InputPin;
class Trigger;

/// <summary>
/// ReplyAction
/// A ReplyAction is an Action that accepts a set of reply values and a value
/// containing return information produced by a previous AcceptCallAction. The
/// ReplyAction returns the values to the caller of the previous call, completing
/// execution of the call.
/// </summary>
class UMLMODEL_EXPORT ReplyAction : public Action {

public: // Constructors and destructors
    explicit ReplyAction(const QString& umlType="uml::ReplyAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// replyToCall getter
    /// The Trigger specifying the Operation whose call is being replied to.
    /// </summary>
    shared_ptr<Trigger> replyToCall() const;

    /// <summary>
    /// replyToCall setter
    /// The Trigger specifying the Operation whose call is being replied to.
    /// </summary>
    void setReplyToCall(shared_ptr<Trigger> value);

    /// <summary>
    /// replyValues getter
    /// A list of InputPins providing the values for the output (inout, out, and return)
    /// Parameters of the Operation. These values are returned to the caller.
    /// </summary>
    vector<shared_ptr<InputPin>>& replyValues();

    /// <summary>
    /// returnInformation getter
    /// An InputPin that holds the return information value produced by an earlier
    /// AcceptCallAction.
    /// </summary>
    shared_ptr<InputPin> returnInformation() const;

    /// <summary>
    /// returnInformation setter
    /// An InputPin that holds the return information value produced by an earlier
    /// AcceptCallAction.
    /// </summary>
    void setReturnInformation(shared_ptr<InputPin> value);

private: // Fields
    /// <summary>
    /// replyToCall
    /// The Trigger specifying the Operation whose call is being replied to.
    /// </summary>
    shared_ptr<Trigger> replyToCall_;

    /// <summary>
    /// replyValues
    /// A list of InputPins providing the values for the output (inout, out, and return)
    /// Parameters of the Operation. These values are returned to the caller.
    /// </summary>
    vector<shared_ptr<InputPin>> replyValues_;

    /// <summary>
    /// returnInformation
    /// An InputPin that holds the return information value produced by an earlier
    /// AcceptCallAction.
    /// </summary>
    shared_ptr<InputPin> returnInformation_;

};

} // namespace uml
